<?php
namespace Back\Model;

use Think\Model;

class BrandModel extends  Model{
    //批量验证
    protected $patchValidate = true;
    //验证
    protected  $_validate=[
        ['title','require','产品名称不能为空'],
        ['title','','品牌名已存在',self::EXISTS_VALIDATE,'unique'],
        ['site','url','网址格式不正确',self::VALUE_VALIDATE],
        ['logo','require','请上传LOGO',self::EXISTS_VALIDATE,'',self::MODEL_INSERT],
        ['sort_number','require','排序号不能为空'],
        ['sort_number','number','排序号应该为数字'],
    ];
    //填充
    protected  $_auto=[
        //更新是维护
        ['create_at','time',self::MODEL_INSERT,'function'],
        //更新是，插入是都进行更新
        ['update_at','time',self::MODEL_BOTH,'function'],

    ];
}
